/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package thePieces;

import Headquarters.viewPerspective.perspective;
import anotherFrameWork.point;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;

/**
 *
 * @author Windows7
 */


public class theKing extends theSpritePieces{
    
    public theKing(String str, point p, colorOfPiexes side, perspective view)
    {
        super(str,p,side, view);
        //buffer = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
	//bufferGraphic = buffer.getGraphics();
	//bufferGraphic.setColor(new Color(234, 34, 34));
    }
    
    public theKing(String str, point p, colorOfPiexes side)
    {
        super(str,p,side);
        //buffer = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
	//bufferGraphic = buffer.getGraphics();
	//bufferGraphic.setColor(new Color(234, 34, 34));
    }
    @Override
    public boolean isMoveLegal(int xi, int yi, int xj, int yj) 
    {
        boolean result = true;
        
        if(Math.abs(xi-xj)>= 2 && Math.abs(yi-yj) >= 2)
        {
            result = false;
        }
        
        return result;
    }

    @Override
    public point movePattern(int xi, int yi, int xj, int yj) 
    {
        point nextPos = new point(xj,yj);
        
        return nextPos;
    }
    
    @Override
    public kindOfPieces getkind()
    {
        return kindOfPieces.king;
        
    }

    //@Override
    public void paint(Graphics g)
    {
        //super.paint(g);
        /*this.bufferGraphic.drawImage(this.backBuffer , 0, 0, this);
        Graphics2D g2 = (Graphics2D) g;
        AffineTransform t = new AffineTransform();
        t.translate(this.inPlace.getX(), this.inPlace.getY());
        t.scale(1, 1);
        this.bufferGraphic.drawImage(this.img, t, view);
        g2.drawImage(buffer, 0,0, view);*/
    }
    
}
